package com.aaa.service.impl;

import com.aaa.dao.LogDao;
import com.aaa.entity.Log;
import com.aaa.entity.LogPageSort;
import com.aaa.service.LogService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ：admin
 * @date ：Created in 2022/7/5 18:01
 * @description：
 * @modified By：
 */
@Service
public class LogServiceImpl implements LogService {

    @Autowired
    private LogDao logDao;

    @Override
    public Page<Log> findAllLog(LogPageSort logPageSort) {
        //开始分页
        PageHelper.startPage(logPageSort.getPage(),logPageSort.getLimit());
        List<Log> logList = logDao.findAllLog(logPageSort);
        return (Page<Log>) logList;
    }

    @Override
    public int saveLog(Log log) {
        return logDao.saveLog(log);
    }
}
